package com.example.forum.services;

import com.example.forum.entity.User;
import com.example.forum.exception.CustomException;

public interface IUserService {

    /**
     * 注册
     * @param user
     */
    void register(User user) throws CustomException;

    /**
     * 登录
     * @param username
     * @param password
     * @return
     */
    User login(String username, String password) throws CustomException;

    /**
     * 根据id获取用户
     * @param id
     * @return
     */
    User getUser(Long id) throws CustomException;

    /**
     * 更新文章数量
     * @param userId
     * @return
     */
    Integer updateArticleCount(Long userId);

    /**
     * 修改用户信息
     *
     * @param id
     * @param username
     * @param nickname
     * @param gender
     * @param email
     * @param phoneNum
     * @param remark
     */
    void modifyInfo(Long id, String username, String nickname, Integer gender, String email, String phoneNum, String remark) throws CustomException;

    /**
     * 修改密码
     *
     * @param user
     * @param oldPwd
     * @param newPwd
     */
    void modifyPwd(User user, String oldPwd, String newPwd) throws CustomException;
}
